package
{
	import flash.geom.Point;
	
	public class Player
	{
		//指代玩家
		//独一无二的视角
		//仅可控制1车辆 - 相关状态
		//发言
		//小队\结盟
		//领袖 - 指挥官
		//名称等
		//记录
		//人工智能
		private var m_pViewPoint:Point = new Point;
		//
		private var m_pTank:MomoTank = null;
		private var m_iLifeTime:int = 0;	//距离复活时间
		//
		private var m_iState:int = 0;	//0-等待中 1-观察者 2-操作员 3-失去控制
		private var m_sName:String = "";//用户名
		private var m_iID:int = 0;		//用户ID
		private var m_iIP:String = "127.0.0.1";//IP地址
		private var m_iGameID:int = 0;//参与的游戏的ID
		//
		private var m_iTeamID:int = 0;//小队编号
		private var m_iForceID:int = 0;//军团编号
		private var m_iCommandLv:int = 0;//指挥等级 0-越高能使用的车辆越高级, 能使用的指挥官技能越多
		//
		private var m_iKillNum:int = 0;//击杀数
		private var m_iDeadNum:int = 0;//阵亡数
		private var m_iKillScore:int = 0;//击杀得分 - 越高级的车辆得分越多
		private var m_iDeadScore:int = 0;//阵亡得分
		//
		private var m_bComputer:Boolean = false;//如果是com,将根据战况加入并选择合适的车辆出击
		private var m_iComLv:int = 0;		//智能等级 0-新手 1-菜鸟 2-中手 3-老鸟 4-精英
		private var m_iComAction:int = 0;	//行为模式 0-保守 1-伴随进攻 2-主动出击 3-勇于战斗 4-个人英雄主义
		//访问方法
		public function viewPoint():Point{
			return m_pViewPoint;
		}
		public function get tank():MomoTank{
			return m_pTank;
		}
		public function get lifeTime():int{
			return m_iLifeTime;
		}
		public function get state():int{
			return m_iState;
		}
		public function get name():String{
			return m_sName;
		}
		public function get id():int{
			return m_iID;
		}
		public function get gameID():int{//为0说明没玩
			return m_iGameID;
		}
		public function get teamID():int{//为0说明没有小队
			return m_iTeamID;
		}
		public function get forceID():int{//为0说明是电脑……
			return m_iForceID;
		}
		public function get commandLv():int{
			return m_iCommandLv;
		}
		public function get killNum():int{
			return m_iKillNum;
		}
		public function get killScore():int{
			return m_iKillScore;
		}
		public function get deadNum():int{
			return m_iDeadNum;
		}
		public function get deadScore():int{
			return m_iDeadScore;
		}
		//
		public function SetViewPoint( x:Number, y:Number ):void{
			m_pViewPoint.x=x;
			m_pViewPoint.y=y;
		}
		public function set tank(t:MomoTank):void{
			m_pTank=t;
		}
		public function set lifeTime(i:int):void{
			m_iLifeTime=i;
		}
		public function set name(s:String):void{
			m_sName=s;
		}
		public function set teamID(i:int):void{//为0说明没有小队
			m_iTeamID=i;
		}
		public function set forceID(i:int):void{//为0说明是电脑……
			m_iForceID=i;
		}
		public function set commandLv(i:int):void{
			m_iCommandLv=i;
		}
		//
		public function get isComputer():Boolean{
			return m_bComputer;
		}
		public function get comLv():int{
			return m_iComLv;
		} 
		public function get comAction():int{
			return m_iComAction;
		}
		//
		public function Player( name:String, id:int )
		{
			m_iState=0;
			m_sName=name;
			m_iID=id;//远程登录直接用IP地址吧 -_-
		}
		//
		public function JoinGame( id:int ):void{
			m_iGameID=id;
			m_iState=1;
			m_pViewPoint.x=0;
			m_pViewPoint.y=0;
		}
		//
		public function SetComputer( lv:int, action:int ):void{
			m_bComputer=true;
			m_iComLv=lv;
			m_iComAction=action;
		}
	}
}